package com.freejava.test_thymeleaf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

// 这里使用Controller注解而不是RestController
@Controller
public class PoloCarController {

    @RequestMapping("/car/detail")
    public String detail(Model m) {
        m.addAttribute("carName", "Tesla");
        m.addAttribute("descr", "Tesla is great！");
        return "detail";
    }
}
